Skip to content

fix: gt done blocked by runtime dirs after MQ submit + push timeout#3462

Open
Cdfghglz wants to merge 1 commit intogastownhall:mainfrom
Cdfghglz:fix/gt-done-runtime-dirs-and-push-timeout
Open

fix: gt done blocked by runtime dirs after MQ submit + push timeout#3462
Cdfghglz wants to merge 1 commit intogastownhall:mainfrom
Cdfghglz:fix/gt-done-runtime-dirs-and-push-timeout

Conversation

@Cdfghglz
Copy link
Copy Markdown
Contributor

@Cdfghglz Cdfghglz commented Apr 1, 2026

Summary

Fixes #3461

  • CleanExcludingRuntime() no longer checks UnpushedCommits or StashCount. These are orthogonal to file-level runtime artifact filtering. After MQ submit, commits exist on the polecat branch (not main) — this is expected and should not block completion. Stashes survive worktree deletion.
  • All git push operations (Push, PushWithEnv, DeleteRemoteBranch, PushSubmoduleCommit) now use a 60-second timeout via context.WithTimeout. When the remote is unreachable, gt done fails cleanly instead of hanging indefinitely.

Changes

  • git.go: Added runWithTimeout(), runWithEnvAndTimeout(), and pushTimeout constant (60s)
  • git.go: Push(), PushWithEnv(), DeleteRemoteBranch() use timeout-aware runners
  • git.go: PushSubmoduleCommit() uses exec.CommandContext with timeout
  • git.go: CleanExcludingRuntime() only checks file paths, not commit/stash state
  • git_test.go: Updated test expectations to match new behavior

Test plan

  • go build ./... passes
  • go test ./internal/git/... passes — all TestCleanExcludingRuntime and TestIsGasTownRuntimePath cases green
  • Manual: gt done in polecat with .beads/, .claude/, .runtime/ untracked + MQ-submitted commits → completes successfully
  • Manual: gt done with unreachable remote → fails with timeout error after 60s instead of hanging

🤖 Generated with Claude Code

Two bugs in gt done that block polecat completion:

1. CleanExcludingRuntime() rejected when UnpushedCommits > 0, but after
   MQ submit commits are on the polecat branch (not main) — expected.
   The function's job is to check if *file-level* changes are all runtime
   artifacts (.beads/, .claude/, .runtime/). Unpushed commits and stashes
   are orthogonal concerns. Removed those checks.

2. All git push operations (Push, PushWithEnv, DeleteRemoteBranch,
   PushSubmoduleCommit) ran with no timeout. When GitLab is unreachable,
   gt done hangs indefinitely. Added 60s timeout via context.WithTimeout
   to all push paths.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@github-actions github-actions bot added the status/needs-triage Inbox — we haven't looked at it yet label Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status/needs-triage Inbox — we haven't looked at it yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gt done blocked by runtime dirs after MQ submit + hangs on unreachable remote

2 participants